﻿@model ViewModels.User._ChangePwdModel

<form method="post" zyf-edit-pwd>
    <p style="color: red;">提示：修改密码后需要重新登录</p>
    <div class="form-group">
        <label asp-for="OldPassword">旧密码：（* 必填）</label>
        <input asp-for="OldPassword" class="form-control" placeholder="确保不是盗号用户" />
        <span asp-validation-for="OldPassword" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="Password">新密码：（* 必填）</label>
        <input asp-for="Password" class="form-control" placeholder="至少6位字符" />
        <span asp-validation-for="Password" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="ConfirmPassword">确认密码：（* 必填）</label>
        <input asp-for="ConfirmPassword" class="form-control" placeholder="确保密码没有错误" />
        <span asp-validation-for="ConfirmPassword" class="text-danger"></span>
    </div>
    <button type="submit" class="btn btn-primary">提交</button>
    <button class="btn btn-default btn-outline-secondary" data-dismiss="modal" type="button">放弃</button>
</form>

<script>
    $(function () {
        $('[zyf-edit-pwd]').submit(function (event) {
            formSubmit(event, {
                url: '/api/Pwd/Edit',
                success: function (data) {
                    $modal.modal('hide');
                }
            });
        })
    })
</script>